<?php


namespace app\api\controller\v1;
use app\api\service\jingdong\JingDongGoodsService;
use think\facade\Hook;
use think\facade\Request;

class JingDongGoods
{
    /**
     * @var JingDongGoods
     */
    private $JingDongGoodsService;

    /**
     * JingDongGoods constructor.
     */
    public function __construct()
    {
        $this->JingDongGoodsService = JingDongGoodsService::getInstance();
    }
    /**
     * 获取开普勒系统商品列表
     */
    public function getSkuList()
    {
        $list   =   $this->JingDongGoodsService->getSkuList();
        return writeJson(200,$list);
    }

    /**
     * 获取开普勒系统商品详情
     */
    public function getSkuDetail()
    {
        $skuId  =   [851509];
        $detail   =   $this->JingDongGoodsService->getSkuDetail($skuId);
        return writeJson(200,$detail);
    }

    /**
     * 获取库存状态
     */
    public function queryAreaStockState()
    {
        $data  =   array(
            "fullAddress"=>"福建省福州市仓山区建新镇亿恒创意广场",
            "quantity"=>15,
            "skuId"=>851509
        );
        $detail   =   $this->JingDongGoodsService->queryAreaStockState($data);
        return writeJson(200,$detail);
    }

    /**
     * 获取库存状态
     */
    public function getBrotherList()
    {
        $data  =   array(
            "skuId"=>[851509,100006539110]
        );
        $detail   =   $this->JingDongGoodsService->getBrotherList($data);
        return writeJson(200,$detail);
    }
}